﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Xml;

namespace SemestralniPraceY35VAN
{
    class Status
    {
        /// <summary>
        /// Properties of the status.
        /// </summary>
        private Hashtable properties;

        /// <summary>
        /// 
        /// </summary>
        public int FriendRequests { get { if (properties.ContainsKey("friendrequests")) return System.Convert.ToInt32(properties["friendrequests"]); else return 0; } }
        
        /// <summary>
        /// Constructs an object representing a status.
        /// </summary>
        /// <param name="venue">XML node with information about the status</param>
        public Status(XmlNode status)
        {
            properties = new Hashtable();

            if (status.Name == "status")
            {
                for (int i = 0; i < status.ChildNodes.Count; i++)
                {
                    properties.Add(status.ChildNodes[i].Name, status.ChildNodes[i].InnerText);
                }
            }
            else
            {
                throw new IOException("Not Status!");
            }
        }
    }
}
